﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Ssb;

namespace Ssb
{
    public partial class Fighter
    {
        /// <summary>
        /// This Enum contains all the animations a fighter can have
        /// </summary>
        public enum FighterAnimationType
        {
            Attack1, Attack2, Attack3, AttackSC4Hi, AttackSC4Lw, AttackSC4S, AttackS4S, AttackS4Hi, AttackS4Lw,
            AttackS3S, AttackS3Hi, AttackS3Lw, AttackAirF, AttackAirB, AttackAirHi, AttackAirLw, AttackDash,
            IdleMain, Idle1, Idle2, Idle3, Grab, AttackGrabN, AttackGrabHi, AttackGrabLw, AttackGrabF, 
            AttackGrabB, Running, Walking, Crouching, Falling, Jumping, SpecialS, SpecialHi, SpecialLw, SpecialN,
            Cling
        }

        public Dictionary<FighterAnimationType, FighterAnimation> FighterAnimationMap;

        public void InitFAnimMap()
        {
            FighterAnimationMap = new Dictionary<FighterAnimationType, FighterAnimation>();

            FighterAnimationMap.Add(FighterAnimationType.Attack1, Attack1);
            FighterAnimationMap.Add(FighterAnimationType.Attack2, Attack2);
            FighterAnimationMap.Add(FighterAnimationType.Attack3, Attack3);
            FighterAnimationMap.Add(FighterAnimationType.AttackAirB, AttackAirB);
            FighterAnimationMap.Add(FighterAnimationType.AttackAirF, AttackAirF);
            FighterAnimationMap.Add(FighterAnimationType.AttackAirHi, AttackAirHi);
            FighterAnimationMap.Add(FighterAnimationType.AttackAirLw, AttackAirLw);
            FighterAnimationMap.Add(FighterAnimationType.AttackDash, AttackDash);
            FighterAnimationMap.Add(FighterAnimationType.AttackGrabB, AttackGrabF);
            FighterAnimationMap.Add(FighterAnimationType.AttackGrabF, AttackGrabF);
            FighterAnimationMap.Add(FighterAnimationType.AttackGrabHi, AttackGrabHi);
            FighterAnimationMap.Add(FighterAnimationType.AttackGrabLw, AttackGrabLw);
            FighterAnimationMap.Add(FighterAnimationType.AttackGrabN, AttackGrabN);
            FighterAnimationMap.Add(FighterAnimationType.AttackS3Hi, AttackS3Hi);
            FighterAnimationMap.Add(FighterAnimationType.AttackS3Lw, AttackS3Lw);
            FighterAnimationMap.Add(FighterAnimationType.AttackS3S, AttackS3S);
            FighterAnimationMap.Add(FighterAnimationType.AttackS4Hi, AttackS4Hi);
            FighterAnimationMap.Add(FighterAnimationType.AttackS4Lw, AttackS4Lw);
            FighterAnimationMap.Add(FighterAnimationType.AttackS4S, AttackS4S);
            FighterAnimationMap.Add(FighterAnimationType.AttackSC4Hi, AttackSC4Hi);
            FighterAnimationMap.Add(FighterAnimationType.AttackSC4Lw, AttackSC4Lw);
            FighterAnimationMap.Add(FighterAnimationType.AttackSC4S, AttackSC4S);
            FighterAnimationMap.Add(FighterAnimationType.Cling, Clinging);
            FighterAnimationMap.Add(FighterAnimationType.Crouching, Crouching);
            FighterAnimationMap.Add(FighterAnimationType.Falling, Falling);
            FighterAnimationMap.Add(FighterAnimationType.Grab, Grab);
            FighterAnimationMap.Add(FighterAnimationType.Idle1, Idle1);
            FighterAnimationMap.Add(FighterAnimationType.Idle2, Idle2);
            FighterAnimationMap.Add(FighterAnimationType.Idle3, Idle3);
            FighterAnimationMap.Add(FighterAnimationType.IdleMain, IdleMain);
            FighterAnimationMap.Add(FighterAnimationType.Jumping, Jumping);
            FighterAnimationMap.Add(FighterAnimationType.Running, Running);
            FighterAnimationMap.Add(FighterAnimationType.SpecialHi, SpecialHi);
            FighterAnimationMap.Add(FighterAnimationType.SpecialLw, SpecialLw);
            FighterAnimationMap.Add(FighterAnimationType.SpecialN, SpecialN);
            FighterAnimationMap.Add(FighterAnimationType.SpecialS, SpecialS);
            FighterAnimationMap.Add(FighterAnimationType.Walking, Walking);
        }

        public Image GetCurrentFrame()
        {
            return new Image(Game, FighterAnimationMap[CurrentAnimation].Anim[FighterAnimationMap[CurrentAnimation].CurrentFrame], FighterAnimationMap[CurrentAnimation].Coords);
        }
    }
}
